<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	request.setCharacterEncoding("utf8");
%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf8">
    <title>书愿清单</title>
    <link type="text/css" rel="stylesheet" href="css/theme.css">
    <link type="image/x-icon" rel="shortcut icon" href="img/booklist.ico">
    
</head>
<body>
	<div id="div1"><img src="img/bj1.jpg" /></div>
	<h1>书&nbsp;愿&nbsp;清&nbsp;单</h1>
		
			<Div class="image"><img src="img/image6.jpg"/>
			<img src="img/image1.jpg"/>
			<img src="img/image2.jpg"/>
			<img src="img/image3.jpg"/>
			<img src="img/image4.jpg"/>
			</Div>

	<form action="mana?action=query" method="post">
		<Div class="lj">
			<input type="image" name="submit" src="img/search1.png" width="25px" height="25px" title="查询"/>
		   <a href="addmsg.jsp" title="增加"><img src="img/add1.png"/></a></Div>	
		   <span class="lj1"><input type="text" name="key" placeholder="请输入书名"/></span>
	</form>
	
	<table class="table">

		<tr>
			<th>ID</th>
			<th>书名</th>
			<th>作者</th>
			<th>出版社</th>
			<th>数量</th>
			<th>备注</th>
			<th>日期</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${list}" var="item" varStatus="status">
			<tr>
				<td>${status.count+(currentpage-1)*10}</td>
				<td>${item.bookname}</td>
				<td>${item.author}</td>
				<td>${item.publisher}</td>
				<td>${item.amount}</td>
				<td>${item.comment}</td>
				<td>${item.date}</td>
				<td><a href="mana?action=delete&id=${item.id}" title="删除" onclick="return confirm('是否删除此记录？');">
				    <img src="img/Delete.png" width="20px" height="20px" /></a> 
						<a href="mana?action=queryid&id=${item.id}" title="修改">
						<img src="img/modify.png" width="20px" height="20px" /></a></td>
			</tr>
		</c:forEach>
	</table>
	<div id="n">

		<ul>
			<li><a href="mana?action=pager&pagenumber=${currentpage-1}">&lsaquo;</a></li>
			<c:forEach var="i" begin="1" end="${totalpage}">
				<c:choose>
					<c:when test="${i==currentpage}">
						<a href="mana?action=pager&pagenumber=${i}">${i}</a>
					</c:when>
					<c:otherwise>
						<li><a href="mana?action=pager&pagenumber=${i}">${i}</a></li>
					</c:otherwise>
				</c:choose>
			</c:forEach>
			<li><a href="mana?action=pager&pagenumber=${currentpage+1}">&rsaquo;</a></li>
		</ul>
	</div>

	<script>
	(
			function(){
				var signal=${signal};
				if (signal==1)
				 alert("操作成功！"); 
				else if (signal==0)
				 alert("操作失败！");  
			}
		)()
	</script>
</body>
</html>